//
//  HomeFourSelectTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/9.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "HomeFourSelectTableViewCell.h"

@implementation HomeFourSelectTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat jianxiWidth = (KScreenWidth - kWidthProportion_In_iPhoneTriploid(30) - kWidthProportion_In_iPhoneTriploid(65)*4)/3;
        NSArray * titleArr = @[@"钢铁超市",@"优质店铺",@"我要求购",@"行业资讯"];
        NSArray * imageArr = @[@"home_one",@"home_two",@"Home_three",@"home_four"];
        for (int i=0; i<4; i++) {
            GLGWButton * g_but = [[GLGWButton alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(15)+kWidthProportion_In_iPhoneTriploid(65)*i+jianxiWidth*i, 0, kWidthProportion_In_iPhoneTriploid(65), kHeightProportion_In_iPhoneTriploid(75)) titleText:titleArr[i] titleLableFont:SYSTEMFONT(12) titleLableColor:kColor_Rule_Black inSuperView:self];
            g_but.image_Name = imageArr[i];
            g_but.tag = 120+i;
            [g_but setImagePositionWithType:SSImagePositionTypeTop spacing:kHeightProportion_In_iPhoneTriploid(5)];
            [[g_but rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
                if (self.Block_FourAction) {
                    self.Block_FourAction((GLGWButton *)x);
                }
            }];
        }
    }
    return self;
}
@end
